//
//  KLSGTabBar.m
//  KaoLaShiGuangFM
//
//  Created by lanou3g on 15/11/8.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//

#import "KLSGTabBar.h"

@implementation KLSGTabBar

//- (id)initWithFrame:(CGRect)frame
//{
//    self = [super initWithFrame:frame];
//    if (self) {
//        
//    }
//    return self;
//}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    //  设置tabBarButton的位置和尺寸
    CGFloat tabbarButtonW = self.frame.size.width / 5;
    CGFloat tabbarButtonIndex = 0;
    for (UIView *child in self.subviews) {
        Class class = NSClassFromString(@"UITabBarButton");
        if ([child isKindOfClass:class]) {
            CGRect frame = child.frame;
            frame.size.width = tabbarButtonW;
            frame.origin.x = tabbarButtonIndex * tabbarButtonW;
            child.frame = frame;
            child.tintColor = [UIColor colorWithRed:234 / 256.0 green:79 / 256.0 blue:56 / 256.0 alpha:1];
            tabbarButtonIndex++;
            // 在3的位置留个空间
            if (tabbarButtonIndex == 2) {
                tabbarButtonIndex ++;
            }
        }
    }
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
